home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_libgtop.idb / usr / freeware / include / glibtop / mem.h.z / mem.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  2.4 KB  |  90 lines

  1. /* $Id: mem.h,v 1.14 1999/02/23 11:42:56 martin Exp $ */
  2.  
  3. /* Copyright (C) 1998-99 Martin Baulig
  4.    This file is part of LibGTop 1.0.
  5.  
  6.    Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
  7.  
  8.    LibGTop is free software; you can redistribute it and/or modify it
  9.    under the terms of the GNU General Public License as published by
  10.    the Free Software Foundation; either version 2 of the License,
  11.    or (at your option) any later version.
  12.  
  13.    LibGTop is distributed in the hope that it will be useful, but WITHOUT
  14.    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15.    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16.    for more details.
  17.  
  18.    You should have received a copy of the GNU General Public License
  19.    along with LibGTop; see the file COPYING. If not, write to the
  20.    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.    Boston, MA 02111-1307, USA.
  22. */
  23.  
  24. #ifndef __GLIBTOP_MEM_H__
  25. #define __GLIBTOP_MEM_H__
  26.  
  27. #include <glibtop.h>
  28. #include <glibtop/global.h>
  29.  
  30. BEGIN_LIBGTOP_DECLS
  31.  
  32. #define GLIBTOP_MEM_TOTAL    0
  33. #define GLIBTOP_MEM_USED    1
  34. #define GLIBTOP_MEM_FREE    2
  35. #define GLIBTOP_MEM_SHARED    3
  36. #define GLIBTOP_MEM_BUFFER    4
  37. #define GLIBTOP_MEM_CACHED    5
  38. #define GLIBTOP_MEM_USER    6
  39. #define GLIBTOP_MEM_LOCKED    7
  40.  
  41. #define GLIBTOP_MAX_MEM        8
  42.  
  43. typedef struct _glibtop_mem    glibtop_mem;
  44.  
  45. struct _glibtop_mem
  46. {
  47.     u_int64_t    flags,
  48.         total,        /* GLIBTOP_MEM_TOTAL    */
  49.         used,        /* GLIBTOP_MEM_USED    */
  50.         free,        /* GLIBTOP_MEM_FREE    */
  51.         shared,        /* GLIBTOP_MEM_SHARED    */
  52.         buffer,        /* GLIBTOP_MEM_BUFFER    */
  53.         cached,        /* GLIBTOP_MEM_CACHED    */
  54.         user,        /* GLIBTOP_MEM_USER    */
  55.         locked;        /* GLIBTOP_MEM_LOCKED    */
  56. };
  57.  
  58. #define glibtop_get_mem(mem)    glibtop_get_mem_l(glibtop_global_server, mem)
  59.  
  60. #if GLIBTOP_SUID_MEM
  61. #define glibtop_get_mem_r        glibtop_get_mem_p
  62. #else
  63. #define glibtop_get_mem_r        glibtop_get_mem_s
  64. #endif
  65.  
  66. void glibtop_get_mem_l (glibtop *server, glibtop_mem *buf);
  67.  
  68. #if GLIBTOP_SUID_MEM
  69. void glibtop_init_mem_p (glibtop *server);
  70. void glibtop_get_mem_p (glibtop *server, glibtop_mem *buf);
  71. #else
  72. void glibtop_init_mem_s (glibtop *server);
  73. void glibtop_get_mem_s (glibtop *server, glibtop_mem *buf);
  74. #endif
  75.  
  76. #ifdef GLIBTOP_NAMES
  77.  
  78. /* You need to link with -lgtop_names to get this stuff here. */
  79.  
  80. extern const char *glibtop_names_mem [];
  81. extern const unsigned glibtop_types_mem [];
  82. extern const char *glibtop_labels_mem [];
  83. extern const char *glibtop_descriptions_mem [];
  84.  
  85. #endif
  86.  
  87. END_LIBGTOP_DECLS
  88.  
  89. #endif
  90.